package day8.lambda.demo2;


import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class test {
    public static void main(String[] args)
    {
        Student s[]=new Student[6];
        s[0]=new Student("ming",14,'男');
        s[1]=new Student("ming",15,'女');
        s[2]=new Student("ming",16,'女');
        s[3]=new Student("ming",17,'女');
        s[4]=new Student("ming",18,'男');
        s[5]=new Student("ming",19,'男');

        Scanner sc=new Scanner(System.in);
        sc.nextInt();
        Arrays.sort(s, (a, b) -> a.getAge()-b.getAge());
       Arrays.sort(s,(o1,o2)->o2.getAge()-o1.getAge());
           Arrays.sort(s,(o1,o2)->Student.test(o1,o2));
          Arrays.sort(s,Student::test);
        System.out.println(s[0].getAge());





    }
}
